package com.ldx.music.result;

import lombok.Data;

/**
 * @author：刘大仙
 */
@Data
public class ResponseResult<T> {

    private int code;
    private String msg;
    private T data;

    ResponseResult(){}
    ResponseResult(T data){
        this.code = 200;
        this.data = data;
    }
    ResponseResult(String msg){
        this.code = 500;
        this.msg = msg;
    }

    public static <T> ResponseResult SUCCESS(T data){
        return new ResponseResult(data);
    }

    public static <T> ResponseResult FAIL(String msg){
        return new ResponseResult(msg);
    }
}
